﻿
namespace ATSV.Web.Services
{
    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.ComponentModel.DataAnnotations;
    using System.Data;
    using System.Linq;
    using System.ServiceModel.DomainServices.EntityFramework;
    using System.ServiceModel.DomainServices.Hosting;
    using System.ServiceModel.DomainServices.Server;
    using ATSV.Web;


    // Implements application logic using the ATSVDBEntities context.
    // TODO: Add your application logic to these methods or in additional methods.
    // TODO: Wire up authentication (Windows/ASP.NET Forms) and uncomment the following to disable anonymous access
    // Also consider adding roles to restrict access as appropriate.
    // [RequiresAuthentication]
    [EnableClientAccess()]
    public class ATSVDataService : LinqToEntitiesDomainService<ATSVDBEntities>
    {

        // TODO:
        // Consider constraining the results of your query method.  If you need additional input you can
        // add parameters to this method or create additional query methods with different names.
        // To support paging you will need to add ordering to the 'FotoSets' query.
        public IQueryable<FotoSet> GetFotoSets()
        {
            return this.ObjectContext.FotoSets;
        }

        public void InsertFotoSet(FotoSet fotoSet)
        {
            if ((fotoSet.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(fotoSet, EntityState.Added);
            }
            else
            {
                this.ObjectContext.FotoSets.AddObject(fotoSet);
            }
        }

        public void UpdateFotoSet(FotoSet currentFotoSet)
        {
            this.ObjectContext.FotoSets.AttachAsModified(currentFotoSet, this.ChangeSet.GetOriginal(currentFotoSet));
        }

        public void DeleteFotoSet(FotoSet fotoSet)
        {
            if ((fotoSet.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(fotoSet, EntityState.Deleted);
            }
            else
            {
                this.ObjectContext.FotoSets.Attach(fotoSet);
                this.ObjectContext.FotoSets.DeleteObject(fotoSet);
            }
        }

        // TODO:
        // Consider constraining the results of your query method.  If you need additional input you can
        // add parameters to this method or create additional query methods with different names.
        // To support paging you will need to add ordering to the 'GaestebuchItemSets' query.
        public IQueryable<GaestebuchItemSet> GetGaestebuchItemSets()
        {
            return this.ObjectContext.GaestebuchItemSets;
        }

        public void InsertGaestebuchItemSet(GaestebuchItemSet gaestebuchItemSet)
        {
            if ((gaestebuchItemSet.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(gaestebuchItemSet, EntityState.Added);
            }
            else
            {
                this.ObjectContext.GaestebuchItemSets.AddObject(gaestebuchItemSet);
            }
        }

        public void UpdateGaestebuchItemSet(GaestebuchItemSet currentGaestebuchItemSet)
        {
            this.ObjectContext.GaestebuchItemSets.AttachAsModified(currentGaestebuchItemSet, this.ChangeSet.GetOriginal(currentGaestebuchItemSet));
        }

        public void DeleteGaestebuchItemSet(GaestebuchItemSet gaestebuchItemSet)
        {
            if ((gaestebuchItemSet.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(gaestebuchItemSet, EntityState.Deleted);
            }
            else
            {
                this.ObjectContext.GaestebuchItemSets.Attach(gaestebuchItemSet);
                this.ObjectContext.GaestebuchItemSets.DeleteObject(gaestebuchItemSet);
            }
        }

        // TODO:
        // Consider constraining the results of your query method.  If you need additional input you can
        // add parameters to this method or create additional query methods with different names.
        // To support paging you will need to add ordering to the 'GalerieItemSets' query.
        public IQueryable<GalerieItemSet> GetGalerieItemSets()
        {
            return this.ObjectContext.GalerieItemSets;
        }

        public void InsertGalerieItemSet(GalerieItemSet galerieItemSet)
        {
            if ((galerieItemSet.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(galerieItemSet, EntityState.Added);
            }
            else
            {
                this.ObjectContext.GalerieItemSets.AddObject(galerieItemSet);
            }
        }

        public void UpdateGalerieItemSet(GalerieItemSet currentGalerieItemSet)
        {
            this.ObjectContext.GalerieItemSets.AttachAsModified(currentGalerieItemSet, this.ChangeSet.GetOriginal(currentGalerieItemSet));
        }

        public void DeleteGalerieItemSet(GalerieItemSet galerieItemSet)
        {
            if ((galerieItemSet.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(galerieItemSet, EntityState.Deleted);
            }
            else
            {
                this.ObjectContext.GalerieItemSets.Attach(galerieItemSet);
                this.ObjectContext.GalerieItemSets.DeleteObject(galerieItemSet);
            }
        }

        // TODO:
        // Consider constraining the results of your query method.  If you need additional input you can
        // add parameters to this method or create additional query methods with different names.
        // To support paging you will need to add ordering to the 'GalerieSets' query.
        public IQueryable<GalerieSet> GetGalerieSets()
        {
            return this.ObjectContext.GalerieSets;
        }

        public void InsertGalerieSet(GalerieSet galerieSet)
        {
            if ((galerieSet.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(galerieSet, EntityState.Added);
            }
            else
            {
                this.ObjectContext.GalerieSets.AddObject(galerieSet);
            }
        }

        public void UpdateGalerieSet(GalerieSet currentGalerieSet)
        {
            this.ObjectContext.GalerieSets.AttachAsModified(currentGalerieSet, this.ChangeSet.GetOriginal(currentGalerieSet));
        }

        public void DeleteGalerieSet(GalerieSet galerieSet)
        {
            if ((galerieSet.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(galerieSet, EntityState.Deleted);
            }
            else
            {
                this.ObjectContext.GalerieSets.Attach(galerieSet);
                this.ObjectContext.GalerieSets.DeleteObject(galerieSet);
            }
        }

        // TODO:
        // Consider constraining the results of your query method.  If you need additional input you can
        // add parameters to this method or create additional query methods with different names.
        // To support paging you will need to add ordering to the 'GalerieTypeSets' query.
        public IQueryable<GalerieTypeSet> GetGalerieTypeSets()
        {
            return this.ObjectContext.GalerieTypeSets;
        }

        public void InsertGalerieTypeSet(GalerieTypeSet galerieTypeSet)
        {
            if ((galerieTypeSet.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(galerieTypeSet, EntityState.Added);
            }
            else
            {
                this.ObjectContext.GalerieTypeSets.AddObject(galerieTypeSet);
            }
        }

        public void UpdateGalerieTypeSet(GalerieTypeSet currentGalerieTypeSet)
        {
            this.ObjectContext.GalerieTypeSets.AttachAsModified(currentGalerieTypeSet, this.ChangeSet.GetOriginal(currentGalerieTypeSet));
        }

        public void DeleteGalerieTypeSet(GalerieTypeSet galerieTypeSet)
        {
            if ((galerieTypeSet.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(galerieTypeSet, EntityState.Deleted);
            }
            else
            {
                this.ObjectContext.GalerieTypeSets.Attach(galerieTypeSet);
                this.ObjectContext.GalerieTypeSets.DeleteObject(galerieTypeSet);
            }
        }

        // TODO:
        // Consider constraining the results of your query method.  If you need additional input you can
        // add parameters to this method or create additional query methods with different names.
        // To support paging you will need to add ordering to the 'NewsItemSets' query.
        public IQueryable<NewsItemSet> GetNewsItemSets()
        {
            return this.ObjectContext.NewsItemSets.OrderBy(n => n.Body);
        }

        public void InsertNewsItemSet(NewsItemSet newsItemSet)
        {
            if ((newsItemSet.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(newsItemSet, EntityState.Added);
            }
            else
            {
                this.ObjectContext.NewsItemSets.AddObject(newsItemSet);
            }
        }

        public void UpdateNewsItemSet(NewsItemSet currentNewsItemSet)
        {
            this.ObjectContext.NewsItemSets.AttachAsModified(currentNewsItemSet, this.ChangeSet.GetOriginal(currentNewsItemSet));
        }

        public void DeleteNewsItemSet(NewsItemSet newsItemSet)
        {
            if ((newsItemSet.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(newsItemSet, EntityState.Deleted);
            }
            else
            {
                this.ObjectContext.NewsItemSets.Attach(newsItemSet);
                this.ObjectContext.NewsItemSets.DeleteObject(newsItemSet);
            }
        }

        // TODO:
        // Consider constraining the results of your query method.  If you need additional input you can
        // add parameters to this method or create additional query methods with different names.
        // To support paging you will need to add ordering to the 'Resourcens' query.
        public IQueryable<Resourcen> GetResourcens()
        {
            return this.ObjectContext.Resourcens;
        }

        public void InsertResourcen(Resourcen resourcen)
        {
            if ((resourcen.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(resourcen, EntityState.Added);
            }
            else
            {
                this.ObjectContext.Resourcens.AddObject(resourcen);
            }
        }

        public void UpdateResourcen(Resourcen currentResourcen)
        {
            this.ObjectContext.Resourcens.AttachAsModified(currentResourcen, this.ChangeSet.GetOriginal(currentResourcen));
        }

        public void DeleteResourcen(Resourcen resourcen)
        {
            if ((resourcen.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(resourcen, EntityState.Deleted);
            }
            else
            {
                this.ObjectContext.Resourcens.Attach(resourcen);
                this.ObjectContext.Resourcens.DeleteObject(resourcen);
            }
        }

        // TODO:
        // Consider constraining the results of your query method.  If you need additional input you can
        // add parameters to this method or create additional query methods with different names.
        // To support paging you will need to add ordering to the 'SpielerSets' query.
        public IQueryable<SpielerSet> GetSpielerSets()
        {
            return this.ObjectContext.SpielerSets;
        }

        public void InsertSpielerSet(SpielerSet spielerSet)
        {
            if ((spielerSet.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(spielerSet, EntityState.Added);
            }
            else
            {
                this.ObjectContext.SpielerSets.AddObject(spielerSet);
            }
        }

        public void UpdateSpielerSet(SpielerSet currentSpielerSet)
        {
            this.ObjectContext.SpielerSets.AttachAsModified(currentSpielerSet, this.ChangeSet.GetOriginal(currentSpielerSet));
        }

        public void DeleteSpielerSet(SpielerSet spielerSet)
        {
            if ((spielerSet.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(spielerSet, EntityState.Deleted);
            }
            else
            {
                this.ObjectContext.SpielerSets.Attach(spielerSet);
                this.ObjectContext.SpielerSets.DeleteObject(spielerSet);
            }
        }



        // TODO:
        // Consider constraining the results of your query method.  If you need additional input you can
        // add parameters to this method or create additional query methods with different names.
        // To support paging you will need to add ordering to the 'LigaSets' query.
        public IQueryable<LigaSet> GetLigaSets()
        {
            return this.ObjectContext.LigaSets;
        }

        public void InsertLigaSet(LigaSet ligaSet)
        {
            if ((ligaSet.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(ligaSet, EntityState.Added);
            }
            else
            {
                this.ObjectContext.LigaSets.AddObject(ligaSet);
            }
        }

        public void UpdateLigaSet(LigaSet currentLigaSet)
        {
            this.ObjectContext.LigaSets.AttachAsModified(currentLigaSet, this.ChangeSet.GetOriginal(currentLigaSet));
        }

        public void DeleteLigaSet(LigaSet ligaSet)
        {
            if ((ligaSet.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(ligaSet, EntityState.Deleted);
            }
            else
            {
                this.ObjectContext.LigaSets.Attach(ligaSet);
                this.ObjectContext.LigaSets.DeleteObject(ligaSet);
            }
        }






        // TODO:
        // Consider constraining the results of your query method.  If you need additional input you can
        // add parameters to this method or create additional query methods with different names.
        // To support paging you will need to add ordering to the 'SponsorSets' query.
        public IQueryable<SponsorSet> GetSponsorSets()
        {
            return this.ObjectContext.SponsorSets;
        }

        public void InsertSponsorSet(SponsorSet sponsorSet)
        {
            if ((sponsorSet.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(sponsorSet, EntityState.Added);
            }
            else
            {
                this.ObjectContext.SponsorSets.AddObject(sponsorSet);
            }
        }

        public void UpdateSponsorSet(SponsorSet currentSponsorSet)
        {
            this.ObjectContext.SponsorSets.AttachAsModified(currentSponsorSet, this.ChangeSet.GetOriginal(currentSponsorSet));
        }

        public void DeleteSponsorSet(SponsorSet sponsorSet)
        {
            if ((sponsorSet.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(sponsorSet, EntityState.Deleted);
            }
            else
            {
                this.ObjectContext.SponsorSets.Attach(sponsorSet);
                this.ObjectContext.SponsorSets.DeleteObject(sponsorSet);
            }
        }

        // TODO:
        // Consider constraining the results of your query method.  If you need additional input you can
        // add parameters to this method or create additional query methods with different names.
        // To support paging you will need to add ordering to the 'TeamSets' query.
        public IQueryable<TeamSet> GetTeamSets()
        {
            return this.ObjectContext.TeamSets;
        }

        public void InsertTeamSet(TeamSet teamSet)
        {
            if ((teamSet.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(teamSet, EntityState.Added);
            }
            else
            {
                this.ObjectContext.TeamSets.AddObject(teamSet);
            }
        }

        public void UpdateTeamSet(TeamSet currentTeamSet)
        {
            this.ObjectContext.TeamSets.AttachAsModified(currentTeamSet, this.ChangeSet.GetOriginal(currentTeamSet));
        }

        public void DeleteTeamSet(TeamSet teamSet)
        {
            if ((teamSet.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(teamSet, EntityState.Deleted);
            }
            else
            {
                this.ObjectContext.TeamSets.Attach(teamSet);
                this.ObjectContext.TeamSets.DeleteObject(teamSet);
            }
        }

        // TODO:
        // Consider constraining the results of your query method.  If you need additional input you can
        // add parameters to this method or create additional query methods with different names.
        // To support paging you will need to add ordering to the 'TeamTypeSets' query.
        public IQueryable<TeamTypeSet> GetTeamTypeSets()
        {
            return this.ObjectContext.TeamTypeSets;
        }

        public void InsertTeamTypeSet(TeamTypeSet teamTypeSet)
        {
            if ((teamTypeSet.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(teamTypeSet, EntityState.Added);
            }
            else
            {
                this.ObjectContext.TeamTypeSets.AddObject(teamTypeSet);
            }
        }

        public void UpdateTeamTypeSet(TeamTypeSet currentTeamTypeSet)
        {
            this.ObjectContext.TeamTypeSets.AttachAsModified(currentTeamTypeSet, this.ChangeSet.GetOriginal(currentTeamTypeSet));
        }

        public void DeleteTeamTypeSet(TeamTypeSet teamTypeSet)
        {
            if ((teamTypeSet.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(teamTypeSet, EntityState.Deleted);
            }
            else
            {
                this.ObjectContext.TeamTypeSets.Attach(teamTypeSet);
                this.ObjectContext.TeamTypeSets.DeleteObject(teamTypeSet);
            }
        }

        // TODO:
        // Consider constraining the results of your query method.  If you need additional input you can
        // add parameters to this method or create additional query methods with different names.
        // To support paging you will need to add ordering to the 'TrainerSets' query.
        public IQueryable<TrainerSet> GetTrainerSets()
        {
            return this.ObjectContext.TrainerSets;
        }

        public void InsertTrainerSet(TrainerSet trainerSet)
        {
            if ((trainerSet.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(trainerSet, EntityState.Added);
            }
            else
            {
                this.ObjectContext.TrainerSets.AddObject(trainerSet);
            }
        }

        public void UpdateTrainerSet(TrainerSet currentTrainerSet)
        {
            this.ObjectContext.TrainerSets.AttachAsModified(currentTrainerSet, this.ChangeSet.GetOriginal(currentTrainerSet));
        }

        public void DeleteTrainerSet(TrainerSet trainerSet)
        {
            if ((trainerSet.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(trainerSet, EntityState.Deleted);
            }
            else
            {
                this.ObjectContext.TrainerSets.Attach(trainerSet);
                this.ObjectContext.TrainerSets.DeleteObject(trainerSet);
            }
        }
    }
}


